package model;

import com.github.crab2died.annotation.ExcelField;

//编制岗位模型
abstract public class AbstractModel
{
	@ExcelField(title = "A级单位", order = 1)
	protected String aName;

	@ExcelField(title = "B级单位", order = 2)
	protected String bName;

	@ExcelField(title = "C级单位", order = 3)
	protected String cName;

	@ExcelField(title = "D级单位", order = 4)
	protected String dName;

	@ExcelField(title = "岗位", order = 5)
	protected String quarter;

	@ExcelField(title = "等级", order = 6)
	protected String rankString;

	@ExcelField(title = "专业", order = 7)
	protected String profession;

	// 数量
	public int number;

	// 辅助变量
	public int tempNumber;

	// 等级
	protected int rank;

	// 专业大类
	protected String mainProfession;

	public AbstractModel()
	{
	}

	public AbstractModel(String aName, String bName, String cName, String dName,
			String quarter, String rankString, String profession)
	{
		this.aName = aName;
		this.bName = bName;
		this.cName = cName;
		this.dName = dName;
		this.quarter = quarter;
		this.rankString = rankString;
		this.profession = profession;
		rank = Integer.parseInt(rankString.substring(1));
		mainProfession = profession.substring(0, 2);
	}

	//完全匹配
	public boolean isTotalMatch(AbstractModel model)
	{
		return quarter.equals(model.quarter)
				&& rankString.equals(model.rankString)
				&& profession.equals(model.profession);
	}

	//等级匹配
	public boolean isRankMatch(AbstractModel model)
	{
		return rankString.equals(model.rankString);
	}

	//专业匹配
	public boolean isProfessionMatch(AbstractModel model)
	{
		return profession.equals(model.profession);
	}

	//岗位匹配
	public boolean isQuarterMatch(AbstractModel model)
	{
		return quarter.equals(model.quarter);
	}

	//主专业匹配
	public boolean isMainProfessionMatch(AbstractModel model)
	{
		return mainProfession.equals(model.mainProfession);
	}

	//岗位及专业匹配
	public boolean isQuarterProfessionMatch(AbstractModel model)
	{
		return quarter.equals(model.quarter)
				&& profession.equals(model.profession);
	}

	//等级及专业匹配
	public boolean isRankProfessionMatch(AbstractModel model)
	{
		return rankString.equals(model.rankString) && profession.equals(model.profession);
	}

	public String getaName()
	{
		return aName;
	}

	public void setaName(String aName)
	{
		this.aName = aName;
	}

	public String getbName()
	{
		return bName;
	}

	public void setbName(String bName)
	{
		this.bName = bName;
	}

	public String getcName()
	{
		return cName;
	}

	public void setcName(String cName)
	{
		this.cName = cName;
	}

	public String getdName()
	{
		return dName;
	}

	public void setdName(String dName)
	{
		this.dName = dName;
	}

	public String getQuarter()
	{
		return quarter;
	}

	public void setQuarter(String quarter)
	{
		this.quarter = quarter;
	}

	public String getRankString()
	{
		return rankString;
	}

	public void setRankString(String rankString)
	{
		this.rankString = rankString;
		rank = Integer.parseInt(rankString.substring(1));
	}

	public String getProfession()
	{
		return profession;
	}

	public void setProfession(String profession)
	{
		this.profession = profession;
		mainProfession = profession.substring(0, 2);
	}

	public int getNumber()
	{
		return number;
	}

	public void setNumber(int number)
	{
		this.number = number;
	}

	public int getRank()
	{
		return rank;
	}

	public void setRank(int rank)
	{
		this.rank = rank;
	}

	public String getMainProfession()
	{
		return mainProfession;
	}
}
